import express from 'express';
import userCrud from '../controller/user';
const router = express.Router();

export = (app: any) => {
  router.post('/login', userCrud.login); // 登录
  router.post('/minePwd', userCrud.minePwd); // 修改密码
  router.post('/restPwd', userCrud.restPwd); // 密码重置
  router.post('/add', userCrud.add); // 添加用户
  router.put('/up', userCrud.up); // 修改用户
  router.delete('/del', userCrud.del); // 删除用户
  router.get('/find', userCrud.find); // 查询用户
  router.get('/info/:id', userCrud.info); // 查询用户
  router.get('/export', userCrud.derive); // 导出用户

  app.use('/node/api/users', router);
};
